package org.prail.net;

import java.io.IOException;
import java.net.MalformedURLException;

import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.TextPage;

public class Updater {
	
	public static boolean newVersion() {
		try {
			TextPage page = Web.getClient().getPage("http://smart-mp3vk-downloader.googlecode.com/svn/v.txt");
			System.out.println("Version: " + page.getContent() + " [" + Configuration.version + "]");
			double version = Double.parseDouble(page.getContent());
			if(version != Configuration.version) {
				return true;
			}
			return false;
		} catch (FailingHttpStatusCodeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return true;
	}

}
